Creating Cache for model and view

And cache tests + a few other minor changes.