remove unused built-in library
add command-line options
close #2. add wait option