Module for read_term should be set before repeat, because it can change after module declaration.
Added required library ref_replace to ref_scenarios
Now the module(_) option refers to the implementation module, while '$set_source_module'(M,M)
should be used to get the context module.