Note, this method was copied to be as close as possible to the 'work' method further down.  It was altered to work with the runOnCluster script runner which passes different parameters and does not initialize wiki specific $wg variables (or any wiki context for that matter).