Circular dependency test for #5651

Additional test #5651 to check for circular dependencies and make sure loading a module from another module does not end up in an infinite loop.