Calendar: Fixed deltat calculation and tables.

Also adds some tests.
Don't crash on lazy initialized string buffers.