Refactor calcVisibility into smaller functions
Refactor calcVisibility into smaller functions

This is done in preparation for returning the index of the last
common ancestor for filtered nodes.

nextstrain/auspice,nextstrain/auspice,nextstrain/auspice