Make todo example shorter and not rely on the DOM.