Make adjustments to allow easier renaming of modules

Introduce macros to make renaming the modules easier. We could have used explicit arguments in some of the functions, but that would have resulted in a bigger patch. Also, this way there's no runtime overhead, and it's all compile-time only.