Move monkey patch to a separate module
Protect against import errors.
Extract patched functions as top-level functions
Create global import more traditionally. Now the patched functions are available directly as well.