Changed from trait to class

Given some life to
Added phpunit tests
Stuff was made here