Abstracted out some functionality from the constructor and created nice _handle* methods for this exact purpose. Also reworked some of the code to be nicer.
Made is so that the login and logout helper functions don't throw exceptions, as that'll be left up the code that calls them.
Tidied up a wealth of code and added some new comments. I may become the words first comment comedian!
This is the migration file for the example gamedata thing.
Added a catch for php errors, so that everything is handled correctly.
Added an ignore for .idea
PhpStorm added this...I think it's important?