Added tests for models
skeleton test classes and refactoring