refactored, fixed several bugs, first tests for dummy app models