Add composer

Add a composer.json file to allow installation from composer, and some other fixes to make it happier