Docblocks and misc cleanup

Resolve conflicts & resubmit https://github.com/civicrm/civicrm-core/pull/2506