Fixed pickling and added unit test for redis backend.