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.
Merged pull request #268