Module context

Do not review yet, I'm expecting failures.
this looks wrong to me. We already have visitors elsewhere which check the correct information about the autoincludes and add an "imports" statement.