Added PHPUnit + model test + other fixes