Some tidying up.

Refactored some code. Updated the readme. Removed some unneeded stuff.