Extract `getopt.js` to its own file.

See #100.