Switch get_all_name_code_pairs to use SQL rather than pickle (eventually all methods here will go that way)