Renderer: Add error-handling middleware.

Side effect: Renamed rendering middleware API to avoid confusion.
0.5.0