Beginnings of state management.

using a simple enum class and switches to control state.