Add model service

This one is a doozy. I want to write tests for it before merging.