Fixed windows build. Fails FUNC_CrossPlatformFileCheck like POSIX systems.
Merged windows fixes, and updated encapsulation code to work in windows.