Recognise valueSeq() and toKeyedSeq() as duals and optmize the chained case. Also: Fix bug where some cacheResult() does not return.