cleanups redux

Redux of https://github.com/dart-lang/spark/pull/2221, which strangely did not get merged in by github.