Uniform coding style, improve windows build, minor fixes/tweaks

Hopefully I picked the right kind of coding style from the two that was in the repo. I'm not sure what you prefer as both kind of bracket styles and `if( something )` and `if (something)` was used.