Refactoring and additional tests

Added all tests for objects in the models package. Now only handlers is
missing tests