Fix style to conform to Google's style guidelines

This fixes the style of the C++ source files to conform to Google's style guidelines as identified by `cpplint.py`.
For automated style checks i would like to add a pre-commit hook and i wonder if `cpplint.py` should be added in the repo under a `/tools` folders for example (not everyone has `cpplint` installed).
The same script could also be used on Travis CI for redundancy.