Added FSM functionality to the router

Not yet complete, dont panic.