traverse(): speed optimization; code consolidation
traverse(): speed optimization; code consolidation

Consolidate and optimise _Msh_doTraverse():
- Instead of having entirely separate versions for shells with BUG_UPP and
  without BUG_UPP, now use 'eval' to insert either "$@" or ${1+"$@"} into
  the function code as is required by BUG_UPP.
- Split the function into _Msh_doTraverse() and _Msh_doTraverseDepthFirst(),
  so the depth-first option is not pointlessly re-checked on every directory
  iteration.
- On shells with [[ and ARITHCMD, use these features for speed optimization.
  Particularly bash benefits; bash is very slow with calling shell functions
  (such as is()), so this optimisation makes traverse() about 3 to 4 times
  faster on bash, given a no-op command such as ':'. On ksh, mksh and zsh
  there is only a minor speed gain.

modernish/modernish