#541. Added cache compatibility. Separated partials. Some optimisations added.