Pass command name to getopt
list-packages: export archive scan function
list-packages: support executable whitelists
list-packages: run executable whitelist with lib/ IN $PATH

This allows executable whitelists to do

  . environment.sh
  . functions.sh

and have access to utility functions
list-packages: remove duplicates from whitelists
status: fix handling of missing status files

When the very first package in the list didn't have a status file yet,
the generated JSON file was invalid.

This issue revealed totally by coincidence when the output of
debci-list-packages was changed to be sorted in the presence of a
whitelist.

We probably need to rewrite debci-status in Ruby soon.