Windows fixes and appveyor integration