misc fixes, and new json schema

Initial json schema. For now only the first example in the specification works.