Make rdf_optimise/1 work with modules (partly).