[XWIKI-3544] Fix rendering cache for on-demand extensions

Rewrite of #257 with applied checkstyle and custom component support