added toggle-all, clear-completed and cleaned up the code