Speaking only of AIWC handles it, and with what I believe are the default key bindings:
Ctrl+N: set group N to consist of exactly the selected units. Any prior units in group N are removed first.
Ctrl+Shift+N: add currently selected units to group N. Group N is not cleared first. This can allow you to have a control group with members on multiple planets. This is the only way I know of to have docks on more than one planet all be in the same group. It is also a huge convenience when you want to add units to a group that contains a dock, since typing N alone selects the mobile ships, but does not select the dock.
Ctrl+Alt+N: remove currently selected units from group N. Members of the group that are not currently selected remain in the group.
Ctrl+X+N: described as "Set group exclusive" in the View Controls window, but seems to work exactly like Ctrl+N. I haven't figured out what this does, and the help text is ~*~, rather than an explanation.
Pressing the number in the sidebar, instead of typing it on the keyboard, selects the group and includes any hotkeyed docks in the selection.