Added command line options; simplified client handling