Rework how arguments are parsed and tested to fix handling of quoted arguments, options arguments, and arguments with "=". (fixes #2113)