Fixed some CMake build issues on Windows.
Fixed some various build failures on Windows.
Updated the file dialog to use more C++-style input streams.
Made some small CMake cleanup changes.