Created mode_fsm

Intended to swap control between the input and output modes when the
enter key is hit.