added serialisation for datetime test
added more unit tests for JSON encoder