setvar is a non-conformant feature that looks slightly neater but is
not portable to other /bin/sh implementations. Making the script
portable is straightforward, so let's do it.
Tests are added to make sure that I didn't break anything major in the
process.
Sponsored by: Klara, Inc.