Separate tab and state models, fix delete issues, dialogs.

Maintain a separate model for tabs and the underlying state
so that we hide tabs for RawContacts deleted during the
edit session.  Also bail out when the last tab deleted.

Manage dialogs so we don't leak activities.  Parse legacy
IM types.  Fixes http://b/2122838
3 files changed