Move runtime-prepending logic into the module API.