misc fixes, and new json schema

Initial json schema. For now only the first example in the specification works.
I'm intrigued. Could you add something to explain what it's used for?