Update documentation and styling

Remove some trailing whitespace, break long lines, make PHPDoc consistent
and update it in places.

Change-Id: I340b43a47e121a44ebd4aaa2a45dff12e945e645