Finite Automata Algorithms in Map-Reduce