Merging in router updates.

The router has been updated to work with closures.