emergency pre-account_cards fixes

I know some of this will conflict with account_cards.  I'll do the merging if necessary.

This is an urgent patch because some data was getting screwy, because there was nothing to prevent multiple accounts on the same card.  We should still add db-level checks, but this should catch and prevent that.

It also fixes some brokenness in adding new accounts to existing cards.