Code style changes

Here's the first part of code style changes. 
They're a lot so I thought it would be best to do them in smaller portions and incorporate them as soon as possible to not cause a lot of merge conflicts for other forks of the project.