clean up generate_previous_next_dict
clean up generate_previous_next_dict

separate it into two functions to avoid repeatedly passing in the same parameters everywhere, and removed some unused if blocks

alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin