Included support for CMake and fixed src directory.
Fixed plenty of code formatting inconsistencies.
Some minor formatting issues.