MDL-43089 Tidy up phpdocs, method names, add a test