Move the definition of the core::internal namespace to imp_module.py. Now all modules have a uniform internal namespace called modulename::internal to go along with the internal include directory.
There are lots of extra includes of macros.h in core due to it being defined elsewhere before, but those can wait.