Group accounts elsewhere under the hood

We need to axes of grouping: whether an account can be used for signing
in or not, and how to group accounts for the Connected Accounts UI. This
is a simplistic implementation of this grouping in the wireup module. It
builds on #2121, and sets us up for a next PR to implement the UI
changes to Connected Accounts (to be calved off from #2053).