Fix circular dependencies loading error

Trying to load a modules that have a circular dependencies lead to the
a `RangeError: Maximum call stack size exceeded`.

When a circular dependency is detected a dummy object is returned to break
the cycle.

Closes #488