Refactor main to make it easier to work with

- Break code out into feature-specific functions called by main
- Add proper indentation
- Remove dead code
- Tweak the whitespace (no tab stops, no trailing whitespace)
Refactor load

- Break stuff out into functions
- Remove old commented code
- Overhaul whitespace (no tab stops, no trailing whitespace)
Some style fixes to the readme
Merge branch 'tlk_refactoring'