removed bashisms: function stuff()
some tweaks to tab completion
more tweaks