Reorganize modules

Initial work in reorganizing modules support, following up on a remark in #953 by @stdweird.

This involves moving both `tools.modules.py` and `tools.module_generator.py` into a `tools.modules` package (including e.g. `tools.modules.modules_tool` & `tools.modules.generator`), and also moving most of the `make_module_*` in that namespace.