Export type-to-validation-function mapping as `validation_function_for_type`.
In return objects, always store the primary error text in `error`; supplemental text, if available, should be in `reason`. Add type-aware validation of per-field `default` properties. Add a small number of initial test cases.
Remove now-defunct `location` type; add `default` property to schema but defer/delegate type checking to lib/validate.js.