cpplint fixes, other refactoring/cleanup as per review