fix a collection of timezone bugs in standard functions
more timezone fixes, plus unittests

There were a few more places I found where we were assuming that DST is on in July, off in December, when in fact it's on in December in the Southern hemisphere.
tweak to be slightly more cautious in use of stack
Merge pull request #2760 from NWilson/incoming

fix a collection of timezone bugs in standard functions