Add composer support

Re-organizes the file structure and adds a composer.json file, making the library ready to be registered with Packagist and distributed through composer. No changes are made to the actual library code.