Changes to how cache/session/etc are handled.

Various items now have an instance() method and helper methods.