Move declarations where they belong, and ...

... use asserts to test ps8_getopt against the real getopt. The only
feature implemented so far is that ps_optind is initialized to 1.