Cope with case where class keyword is on the line before the class name.
Giant refactor for own internal json encoding
It now understands the difference between arrays that should be encoded as json arrays, and arrays that should be encoded as objects.
This deprecates the Type interface, replacing it with a JsonType interface.
It also renders writeArray() somewhat less useful. Unless you have a very good reason, you should stop using it.
Merge pull request #26 from JonathanO/master

New json encoding implementation to resolve issue #25