Re-factored principally so that blocking operations can be managed. Caching is also provided for resource retrieval. Thanks also to Nilanjan Raychaudhuri for his contributions.

A self populating cache is now used in order to avoid any thundering herd issue.