Feature/improved windows support

Merge in windows changes ready for testing with bamboo 5.