simpler code
removed defmodel
Split some code to json-schema module.

- Move some code from `core` module to a new `json-schema` module.
- Should fix last corner cases with meta-data.