Separated model core to the model api, closes #7