Tidied up Redis implementation. First working draft.