Fix bug where route was not being passed properly to route handler.

Due to JavaScript closure, the route variable remained in scope for
the route handler. However, this route did not necessarily correspond
to the route currently being accessed. It was always the route that
is last specified in routes.json. Stupid bug :P