Add windows support

Pull in changes from fork.