add verbosity option
fix bug where -D cannot be the only segment dump opt
add cleanup function and refactor error handling
reorder some operations
add SIGINT handler
tidy up the code a bit
bug fix: record not cleared on every read from maps