Fix warnings and errors in 'web_ui' detected by dart2js.

Addresses bug: https://code.google.com/p/dart/issues/detail?id=12526

R=jmesserly@google.com

Review URL: https://chromiumcodereview.appspot.com//26355003