add phpunit tests and composer

It would be nice to install this useful library via composer.