(NC-157) Include offending cycle in the inheritance-cycle exceptions
(NC-157) Return a nicer error in the JSON for cycles
(NC-157) Document error response for group inheritance cycles
(NC-157) Refactor get-ancestors

Clean up the conditionals in get-ancestors a bit
(NC-157) Clarify and refactor code around get-subtree

This refactors get-subtree slightly, refactors the tests around it, and adds
some clarifying documentation.
(NC-157) Use name instead of UUID for inheritance-cycle message

Since the full groups are included in the details key, using group names
instead of the UUIDs in the plain english error will probably be more user
friendly without introducing too much ambiguity.