Documentation

Add comments to code and add documentation in the form of
README.md.  Also features some code cleanup