fix imports

I didn't merge with master before today and because there wasn't anything new for me with the windows commit and discovered that it breaks the OS X build. The regression was an `if` instead of `elif`. I changed the whole thing so that we just do the system-dependent imports one place.