Speed-up lookups for user_ids and folder_ids using a simle dict-like caching class. To be extended to use memcache