Tidyup

Proposed updates to modernise code. A few more updates to come.
Feel free to propose a PR to fix the whitespace issues in the entire project. I'm just being as consistent as possible with all the existing code.