improve build windows portability
misc build/portability details
small steps towards a windows build