Fix type declaration of validator (first argument to function was wrong)
Move around bits of jsoSchema.js so it's easier to read
Rename type validator to schema (because it's actually the schema, not the validator...)