Add tests for `TypeMap#fetch` and push up to `TypeMap`

It doesn't make sense for the subclass to implement this method, and not
have it on the parent. We can also DRY up the implementation of
`#lookup` to be defined in terms of fetch, which will give us a single
point of entry
Reintroduce cache with tests