I fixed (2) and (3). Here's my explanation on this in the commit message:
Adding some optional dojo.requires to run j2-admin's permissions management portlet and constraints management portlet.
The main problem is that dojo widgets are available only when the dojo requires are written during page loading.
If dojo requires statement for a specific widget is added in the loaded page later, then the widget cannot be accessible by dojo.widget.getId().
In the previous version, head contributions are initially done by a separate lifecycle for every portlet window.
However, in JS-2.2's desktop mode, head contributions are done for each portlet content after page loaded and dynamically added into the page.
This is why permissions management portlet and constraints management portlet did not work.
To resolve this problem, we can choose the following possible options:
(a) Add all dojo widget requires statements for j2-admin portlets in the headtag.xml, so every widget requires lines are to be added by default.
(b) Consider to upgrade dojo toolkit if possible.
(c) If dojo.requires statements are newly added by a portlet window under desktop mode, reload the page.
For 2.2 release, I'd like to stick to (a) because of the time constraints and reducing risks.