Fix replace bug in order match
Added scala implementation of Executor.