dir.sh: Template substitution with awk

Replaced sed for the template substitution with awk, because you can
leave the input string unescaped. Also did some minor code cleanup.
dir.sh: Made using a template optional
dir.sh: Changed commandline options; reworked ls arguments
dir.sh: Some Fixes and cleanups
dirs.sh: Add requirements