replaced getopt by a version with BSD license; removed unistd.h replacement