Upgraded to 3.1 and added composer.json 

Ready for submission on [packagist](https://packagist.org/)