State machine classes and logic beginning to be fleshed out.