support for hierarchical module naming schemes

@geimer: this should fix the problem that's blocking you right now

I might need to figure out one more thing w.r.t. the devel module name before this really works for you, I'm looking into that...
@stdweird: I've opened dedicated PRs for moving the file stuff in a dedicated `tools.fetch` module (see #967), and for reorganizing the modules support (see #968).

I don't think either of those should be blocking this PR any further.