Introduce a runtime cache into the environment.

It is a general-purpose runtime cache scoped to the environment instance. It is not persisted anywhere. One use case is to avoid repeating an expensive operation across multiple instances of the same class.
Add missing require.
Refactor: avoid stubs in tests.
Some introductory functional tests on the git source.