Finished rewrite of LuaScriptProcessor.

Added a few n^2ed searched but not a speed problem currently