Default to the previously selected user/group in the rights editor

Prevents confusion across form submission by keeping the rights editor
looking at the same principal panel.  Resolves [rt3 #19205].

This works even for newly added principals, which need translation from
a submitted Name to a principal ID.  Part of this translation/lookup
logic is refactored out of ProcessACLs() so that both the backend and UI
piece can use the same code (_ParseACLNewPrincipal).

Anchor generation is changed to omit the grouping name to cleanly
separate this code from the principal map generated by
GetPrincipalsMap(), rather than adding assumptions.

Based on an initial implementation by sunnavy.
Stay on the same rights subtab when switching between principals

By hooking the "show" event instead of the "select" event we avoid an
infinite loop when we then select the new tab in each tabset: by the
time "show" fires, the selected tab is already correct.

Based on an initial implementation by sunnavy, which differed primarily
in hooking the "select" event and unregistering/re-registering to work
around the loop.

Resolves [rt3 #19769].
Preserve the selected rights category tab across page reloads

For example: granting a right to "Privileged" from the "Rights for
Administrators" tab will return you to both tabs after submission.

We still need the anchor framework for the principal tabs in order to
translate newly added principals to their correct tab server-side.  The
non-newly-added-principal side could be replaced with similar cookie
usage, but it seems not as worthwhile since we'll still be stuck
wrangling anchors.  One slightly verbose method is better than two
competing methods.
Merge branch '4.0/rights-editor-tab-state' into 4.0-trunk