refactor Phase option parse: make 'goal help' info available to other tasks

It would be nice if Pants' Goal Reference doc showed our command-line flag help.
This change refactors some code out of the Help task and into helper functions.
There, a doc-generation task could reach it.