OS compatibility and generic cleanup.

Removed bspatch/patchlib
Now builds and runs on Windows