Minor refactoring, break out compat.hpp.