I've been pretty useless finding offsets (Quietust is so much smarter than me...), but I've made progress on the custom-group stuff.
I can create custom groups, assign dwarves to one or more, delete groups, sort/group by custom group in the display, and save/restore group names between sessions.
My plan is that group names are global (like custom professions), but that dwarf-to-group assignments are stored per-fortress, keyed off the name of the fortress and maybe some other unique thing I can extract easily. (I don't want to dork around with finding the save dir yet, but that's probably where I should end up.)
I'll put up a pull request for review when I get the last bit wrapped up, but I had one question for now: to get the fortress name I need to wait until DFInstance is populated, which is after settings are normally read. One option is to load them all from the settings file and then use whichever ones when we connect. The other, which I prefer and which will fit better with the save-dir future, is to add a hook that gets called after connecting to DF, which will pull the right group info out of the settings file (I'd ignore it on the initial load). Splinterz, does that sound OK to you?
(Also, clang pointed out two warnings that look legit -- the code happens to work, but what's expressed is almost certainly not what's meant. I'll post a separate PR for those.)