Work on fixing windows build - abandon CMake because windows
makes linking shared libraries really diffcult (and hard to
debug). Lots of smaller fixes as well.