Implemented generic cache, made interface and abstract types derivable by default.
Implemented test.