Fix OS X Compile

There was a start to a few `#ifdef __linux__` to avoid `remap` problems on OS X, but this pull finishes that work so all the tests compile and pass.