Pull out code from Decks into CardEditing.