Add tests for user model. Closes #1