Aggressive code organisation and rename.

Not perfect but moves things to roughly the right buckets in
preparation for a second clean-up phase.
Merge pull request #11 from markhibberd/topic/moves

Aggressive code organisation and rename.