Implement data model

Closes #1