Refactor to-do code and add priority editing