Fix CodeSniffer warnings and errors

These appear to be the last fixable warnings and errors without having to go
out of our way. Causes of remaining failures should be discussed.

Change-Id: I3eab533d66a8836a736704f8ad5d7e08edb7546b
Merge "Fix CodeSniffer warnings and errors"