handle optional training slashes

The patch you've been waiting for!

staged at: http://optional-trailing-slashes.dart-lang.appspot.com/

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