Updated readme, and cleaned up code.

Generally improved commenting, and layout of code.