Thermohaline loops, Stommel box models and Sandstrom's theorem