Code-cleanup and create README.md

I made a few changes that are mostly about style and documentation.