Clean up javascript for rendering lists with nested todos.