Add quoting, remove backticks, use $PWD

* http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_03
* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08
Do not quote $@

Quoting `$@` passes it as one argument, which confuses `getopts` under
dash.
Further localize IFS changes
Quote the $@