Remove uses of `expr`

4 commits that cleanup code by using more shell built-ins.