Add proper caching for User model

- JSON is serialization format
- Uses redis

Change-Id: Ib96a5c407864619bd224f96108c1eaa21d7e582f
Add caching for query, query_rev and query_run

Use pickle instead of json, because too lazy to write a JSON
serializer for DateTime

Change-Id: I75a097b572fbc98ee7601e0dd5d43bba3ccac13d