add max capacity, priority handling to Cache

as described in #36