Potential bug fixing and refactoring

-Proper and hopefully safe check for toxv2
-Decomposition of account creation code into blocks