Group topology terms in Automaton algorithm

This pull request changes the way that the automaton algorithm treats link nodes. It now groups all link terms that are in parallel composition into a single entity, which link-free terms do not distribute over until local policies are generated.

Along the way, a few program transformations were modified so that they are tail recursive, thus eliminating stack overflow errors for large networks (hundreds of hosts).

This also incorporates feedback from the code review.