Create EntityCache interface

Move entity cache into an interface.

Create two implementations using vectors and
hashmaps.

Add simple implementation of search.