Adding command line parsing, proper shutdown, replaced queue with pipe