Some code cleanup + bugs removed. Parsing can tolerate errors, and loading/saving of the brain is in a separate process. This combined can hopefully allow the state to always be saved, regardless of potential mishaps.