Move logic from middleware to a domain object JsonSchemaService. Improve middleware tests.