refactor and move analogical set code into Result

Refactor, rename, reword, comment, etc. wherever possible. Add a
comment for the structure of the `gangs` variable, which works
towards issue #11 (just two variables left).

Move the analogical set printing logic into Result. Things are
still getting messy but slightly more manageable than before. Condense
the code from two loops into one by printing the analogical set grouped
by common contexts instead of in order of appearance in the data set.
I believe that this is a clearer presentation, anyway, especially since
it groups items that have the same numbers together (all items in a
context have the same number of pointers).

Update TODO.