Code cleanup

Fixing all the indenting! Was all over the place before, so at least we can have clean code to work with :)

(Not sure whether this will cause a whole heap of merge conflicts for anyone who's been making changes already though...)