Build improvements for OS X and Windows

I have other, more interesting changes coming for Windows, but let's see if we can get you to accept these first.