Switch JSONEncoder to use ISO dates.

  Move handling to parse them into a util file. In addition, clean
  up the validation on the incoming objects, and fix the tz handling.

  Close #110