refactor: Extract `Handler` from `Middleware`

Expose the `Handler` object to allow for custom route processing.