Indentation
Don't store conversationType on messages

This was used to conditionally render messages in the group style, but
it's actually unnecessary. We can render the same markup in both cases
and change the appearance with css.
Support for lower-level queries on indexedDB

superfeedr has done a nice job with this backbone -> indexedDB adapter,
but their query interface is somewhat limited. This commit adds an
alternate interface that lets us specify the index and cursor bounds we
want. This interface requires deeper knowledge of indexedDB indices, but
is more powerful overall.
Rewrite ReplayableErrors

ReplayableErrors make it easy for the frontend to handle identity key
errors by wrapping the necessary steps into one convenient little
replay() callback function.

The frontend remains agnostic to what those steps are. It just calls
replay() once the user has acknowledged the key change.

The protocol layer is responsible for registering the callbacks needed
by the IncomingIdentityKeyError and OutgoingIdentityKeyError.
Refactor background page and replayable errors

Ground work for handling identity key changes and delivery receipts.
Render identity key errors

Thanks to some refactoring of replayable errors and background page,
identity key change errors now display in the message view
Background refactor

break out events
move first install stuff to top
inline some things that dont need an event
move delivery receipt handling
wait for save before decrypting
remove dead code

Dont use runtime events when not needed,
use a partial compound index query,
use a shared background messagecollection
Catch identity key errors and save them on the model
Do something with delivery receipts
Modify active flag

Use 1 for active instead of true.

Unset active instead of setting to false. This will make it disappear
from the inbox index.
DB/Index Redux

This change removes the timestamp field from messages and conversations
in favor of multiple semantically named timestamp fields: sent_at,
received_at on messages; active_at on conversations. This requires/lets
us rethink and improve our indexing scheme thusly:

The inbox index on conversations will order entries by the
conversation.active_at property, which should only appear on
conversations destined for the inbox.

The receipt index will use the message.sent_at property, for effecient
lookup of outgoing messages by timestamp, for use in processing delivery
receipts.

The group index on conversation.members is multi-entry, meaning that
looking up any phone number in this index will efficiently yield all
groups the number belongs to.

The conversation index lets us scan messages in a single conversation,
in the order they were received (or the reverse order). It is a compound
index on [conversationId, received_at].
Delivery receipts

Look up messages by sent_at and filter for those sent to the delivery
receipt's source, or groups that source is in.
Identity key change handling

When an incoming idenity key change is accepted, the old key is wiped,
the associated imcoming message is decrypted and has its contents
updated, and the error is removed.

To facilitate this process, the message uid (which can be used to fetch
the saved message from the database) is passed along with the decrypted
content to update records in the database.
Fix tests