Implement the new cleaner rendering API, fix a test that intermittently failed