Files & Dirs update. Changed FSM so it can take arbitrary number
of the states.