reify module list in TH
This patch is for the use-case detailed in #7867 (closed).
The added Q monad method provides the ability to get a list of module names in a format that is compatible with the module annotation reification in #8337 (closed).
The patch contains a helper method that depends on #8337 (closed), so that should be applied first. If this is problematic, it's easy to separate this patch into one that doesn't depend on #8337 (closed) and an other that does. Then we can add the latter later.