In my opinion, the whole account system needs to be removed from the code. You really should stop using it.
This is very wise opinion. From the accounting/auditing point of view the present wallet model is badly broken. Transactions should be stored in a sequential csv file that is instantly usable by any of the accounting packages for businesses or consumers.
Since the wallet.dat database is essentially append-only this would be relatively simple modification to the existing code. Berkeley DB already supports flat-text database files, but the database model need to be changed from Btree to RecNo.