JSON extensions.
Finished JSON stuff, added some more generic utility functions.
Merge pull request #2 from rjeschke/json

JSON refactorings