Move version-specific code to the _compat module.