Separating out update_priorities so don't have to run rebuild; also
fixing output_priorities so that changes to priorities will be saved.