Pull cache type into its own file.

This also creates a byteCache interface which stores []byte (instead of
interface{}), which means we can add an implementation backed by
memcached.