Sync router.js to 1562462f.

Duplicates changes made in:

https://github.com/emberjs/ember.js/pull/5343