refactor to use class-based model
Merge pull request #7 from dimagi/refactor

refactor to use class-based model