Source tidy up

Just tidied up the source a bit, no trailing spaces, new lines at the end of a file etc.