[misc] Partially revert 73af9c736314c556414685e1ff98c96045baac70 since some features stopped working due to http://jira.xwiki.org/browse/XWIKI-10191