Create StateMachine.js

Basic state machine implementation. Includes State, Transition, and StateMachine functions. Will need to create Conditions for each Transition, like in project 1 implementation.