Added cache support for extensions

Added db and memcache support for extension
this depends on https://gerrit.wikimedia.org/r/#/c/148354/

Change-Id: I0ad0b1b2399051db882eb9df3052abb9da1051af
Merge "Added cache support for extensions"