Update formatting for all pure Dart code in the repo.
Mostly internal refactoring needed to make ts2dart and DartAnalyzer happy. Fixes #2415