Cleanup loaded features and constants after dependency tests.

cc @senny
what about `A::B`?