Encoded associations

Encode and decode active record objects when reading from and writing to cache.