Multiplatform support

New PR to try to get AppVeyor to build it.