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

Rewrite of #257 with applied checkstyle and custom component support
I don't think this is correct since 6.2 is not released yet :) Should be 6.2M1 maybe?