Test and code for scoping rules of nested modules

The declarations contained in the modules should be nested.