Reformat according to clang-format.
Be much stricter when compiling. Fix lots of warnings. Detect realpath instead of always overriding it on Windows.