rewrite

Added cookie fall-back and caching. Removed window storage and
serialization.