Refactoring + add PHPUnit tests
Merge pull request #1 from techdivision/master

Refactoring + add PHPUnit tests