Moved a lot of account stuff into CodeFramework.