Moved the code for testing entrypoint patching into a helper library so that it can be used for more than just GLX.