Read cache before upgrading

Previously upgrading would only work if something else read the cache.
Now it's ensuring quelpa is initialized (and thus, the cache read).
Extend pcase matching to work with cached results