Helper functions for test model

@kitsao, please review. See details #137 .
The only object of this branch was to create helper functions and use them in the code base where appropriate. Since these changes are strictly code related and do not affect the UX, I've not added any documentation, tests, or permission info.