Major rewrite to make things work with dstores, cache is still disabled at this stage