Refactor get_unread_message_ids_per_recipient().
Refactor get_unread_message_ids_per_recipient().

We now have two helper functions:

    * get_raw_unread_data
    * aggregate_unread_data

Separating the concerns is nice.  The first function does
all the data collection.  The second function should be fast,
and it only re-organizes the data into an aggregated form
that makes the page_params payload smaller and easier for
clients to work with.

For the first function, we try to return data structures
that are easier to manipulate than the end result.  This
will allow us to apply events more easily, in a subsequent
commit.

timabbott/zulip,rht/zulip,kou/zulip,hackerkid/zulip,rishig/zulip,mahim97/zulip,kou/zulip,jackrzhang/zulip,punchagan/zulip,zulip/zulip,mahim97/zulip,jackrzhang/zulip,tommyip/zulip,jackrzhang/zulip,andersk/zulip,zulip/zulip,mahim97/zulip,synicalsyntax/zulip,shubhamdhama/zulip,timabbott/zulip,eeshangarg/zulip,synicalsyntax/zulip,hackerkid/zulip,timabbott/zulip,rishig/zulip,zulip/zulip,shubhamdhama/zulip,Galexrt/zulip,hackerkid/zulip,tommyip/zulip,andersk/zulip,showell/zulip,hackerkid/zulip,showell/zulip,rishig/zulip,brainwane/zulip,kou/zulip,synicalsyntax/zulip,Galexrt/zulip,rht/zulip,brainwane/zulip,kou/zulip,dhcrzf/zulip,jackrzhang/zulip,rishig/zulip,kou/zulip,zulip/zulip,synicalsyntax/zulip,timabbott/zulip,Galexrt/zulip,brockwhittaker/zulip,brainwane/zulip,rishig/zulip,showell/zulip,shubhamdhama/zulip,dhcrzf/zulip,eeshangarg/zulip,shubhamdhama/zulip,brainwane/zulip,andersk/zulip,rishig/zulip,showell/zulip,jackrzhang/zulip,mahim97/zulip,jackrzhang/zulip,andersk/zulip,synicalsyntax/zulip,rht/zulip,showell/zulip,dhcrzf/zulip,mahim97/zulip,synicalsyntax/zulip,rht/zulip,shubhamdhama/zulip,brockwhittaker/zulip,showell/zulip,tommyip/zulip,tommyip/zulip,brockwhittaker/zulip,zulip/zulip,tommyip/zulip,zulip/zulip,hackerkid/zulip,showell/zulip,tommyip/zulip,brockwhittaker/zulip,punchagan/zulip,rht/zulip,dhcrzf/zulip,brockwhittaker/zulip,hackerkid/zulip,punchagan/zulip,punchagan/zulip,eeshangarg/zulip,timabbott/zulip,dhcrzf/zulip,dhcrzf/zulip,jackrzhang/zulip,Galexrt/zulip,shubhamdhama/zulip,brainwane/zulip,rht/zulip,rht/zulip,eeshangarg/zulip,synicalsyntax/zulip,rishig/zulip,eeshangarg/zulip,brockwhittaker/zulip,punchagan/zulip,andersk/zulip,Galexrt/zulip,shubhamdhama/zulip,timabbott/zulip,dhcrzf/zulip,zulip/zulip,hackerkid/zulip,punchagan/zulip,eeshangarg/zulip,tommyip/zulip,kou/zulip,kou/zulip,brainwane/zulip,mahim97/zulip,brainwane/zulip,andersk/zulip,Galexrt/zulip,timabbott/zulip,eeshangarg/zulip,andersk/zulip,Galexrt/zulip,punchagan/zulip