Add serialization for cache items. gh-16