Use portable "current directory" command

Based on <https://stackoverflow.com/a/246128/96588>.
Use latest shell includes