Composer, PHPDocs

Added PHPDocs to classes.
Added composer.json file (which may not work).
Minor bug fixes.