Extract renderer object

* Adds better rendering tests.
* Extracts the rendering code from `Base` into `Renderer`.
* Replaces the `Demo` object with a `DemoRenderer`.
* Fixes command line rendering for search.