Little (probably incorrect) fsm for parsing AT commands