Style changes and restructuring

Client wished for style changes. Which is mostly reflected in this
latest commit. Also cleaned my code up a tonne.