Generalized statemachine module. Moved elevator sm to elevator.c