minimal/do: write my own replacements for dirname and basename.
minimal/do: write my own replacements for dirname and basename.

This greatly reduces the number of fork+exec calls, so in particular,
t/curse/all.do now runs much faster:

   /bin/sh (bash): was 5.9s, now 2.2s
   /bin/dash: was 3.2s, now 1.1s

Obviously improving the speed of minimal/do doesn't really matter, except
that it makes a good benchmark to compare the "real" redo against.  So far
it's losing badly: 5.4s.

pombredanne/redo,pombredanne/redo,apenwarr/redo,apenwarr/redo,rowhit/redo,rowhit/redo,pombredanne/redo,apenwarr/redo,dinkelk/redo-python,dinkelk/redo-python,rowhit/redo,pombredanne/redo,apenwarr/redo,dinkelk/redo-python,rowhit/redo,dinkelk/redo-python