Added option to memcached db queries. Also falls back to file caching