Add schema, validate-tests, refactor