Cygwin support

Non-intrusive modifications to support Cygwin platform.