LOTS more work - build now works-ish on Windows