Fixed MongoDate serialisation and deserialisation with negative timestamps.

Apparently MongoDB uses the Euclidean modulo operator instead of C's truncated
modulo operator. This is difficult to test automatically, as calling out to the
mongo shell is impractical.

I have tested with a range of numbers, including ones close to the Epoch.