Permit engine shims to be overridden

This change makes it possible for a package to override the module used
for a shim.  Previously, engine shims took precedence over package
shims.

Includes a separate commit with a spec to verify that the problem previously existed and is fixed by the latter commit.