Clear out the dependency registry between tests

As part of the process during several tests setUp
where the backends are reloaded, automatic dependency
injection takes place. The REGISTRY is being updated
with new providers and it's also looking up the
required dependencies. Some of the providers for the
requirements may not have been updated yet with the
new provider object, so it loads an object that
was created from a previous test run rather than the
current one. This can cause tests to
fail when one class gets a ref to the old one
(it depends on the order that the tests are run).

This change clears out the registry of providers before
loading backends. It only affects testing.

Part of fix for bug 1204605

Change-Id: Ib845493fa13531225e4be7e3b6cc315b9d19a0f4
Handle circular dependencies

The dependency injection code doesn't handle circular
dependencies. This change makes it so that the
dependency injection code allows circular dependencies.

Part of fix for bug 1204605

Change-Id: I8de166a352ac727c7ddf27bae420b7c7ab22415f
Merge "Clear out the dependency registry between tests"
Merge "Handle circular dependencies"