Fixes to cache implementation so that it basically works.  Still not sure about events.