More phpdoc fixes (including to buildtools templates); clean up whitespace
merge d70bbb3425f528d7e53bcb0e00e5a23b25b08df7