Handle SIG TERM and INT to deregister

Also use *Var for flags so you don't have to dereference everywhere you
consume the flags.
Merge pull request #8 from crosbymichael/handlesigs

Handle SIG TERM and INT to deregister