Refactor the graph printing into its own function.

This makes it much easier and cleaner to add a second, non-Unicode
implementation and possibly even a non-color version.