Massive universal rejig.

Split code up into separate files and classes.

Some code cleaned, should make further tidying much easier.
Removes the entire message system...