Cygwin support

Updated cygwin support,  based on work #138