Fixed build errors on MS Windows.
Fixed crash in the logger.

Moved the Log constructer from the header to the source file to avoid memory
corruption between dll and program.
Fixed formatting.