Serialize datetime to a string when dumping JSON

Resolves #28