Clean up phpdoc comments and code lint.
Reformat overly narrow comments.
Add support for configurable user-agent.