Update man.py to get docstrings with ast instead of regexes

A more reliable way of getting docstrings from scripts than plain regex. Uses the `ast` module to parse the command and get its docstring, which uses the actual Python parser internally and should find anything that is a valid docstring. It is also safer than importing the command and getting `__doc__`, because `ast` doesn't execute the code it parses.