Cleanup and coding standards
Merge pull request #1 from juho-jaakkola/cleanup

Cleanup and coding standards - untested by me - i see lots of changes, mainly to indent levels.