Add internal_id support and fix bug.

Fix bug where in memory card list was not cleared after removing cards
in the DB. Add support for internal id field on DataCard.