Added route caching, global "before" and "leaving" handlers.