Use C++ classes for better separation of code.
Create some classes for most of the toy functions.
Get a basic structure for the states.