windows support WIP
more changes to get it compiled on windows