Process accounts first, then groups.

As groups reference accounts, we need to make sure the references stay
accurate even after the accounts are moved about.

Change-Id: I05725425e5dd174cf338a38ef261b66b7db46395
Fix undefined symbol errors.

Change-Id: I8db39d7a863d94c2af1f24ef44e614663ccefb54