Caching and backend module.

Commit adds some basic caching features.
Now backend is module.

Tasks:
fixes #14
fixes #9