Add a test verifying correct handling of global and var-decld variables
in module requires.