Cleaned up cachemap.

It now includes tests

Signed-off-by: Luis Pabon <lpabon@redhat.com>