less intrusive memory management

this patch adds the class `memory_cached_mixin` which adds all
member functions and member variables needed by the memory management
subsystem