[Issue 294] Add pluggable in-memory caching

This pull request is related to the issue #294.
Yes, I will remove this part of commit.