Generate man pages without a WP install

Similar to #312.

Tasks:

* [x] test generating man pages for third-party commands
* [x] move code from `php/man.php` into `php/commands/help.php`