Software or method for moving between Thunderbolt display and laptop resolution
Have a look at Stay or Moom.

Stay is specifically designed to combat this problem. It remembers window positions for a given display configuration, then switches between them as you switch displays. So when you disconnect your Thunderbolt display, your windows will resize to your settings for internal only.

Moom is a bit more of a general purpose window manager, it has a lot of different ways to reposition windows, but it also allows you to save sets of window positions, and you can set it to load one of those when the display arrangement matches certain rules.