Enable specifying JSON type

For example, suppose you want to serialize an enum as int instead of string.
Handle DateTime the same way JavaScript handles Date objects