Fixed a few minor issues
Added phpunit for testing