Separate interface code into functions.

Also track interface totals.
Remove output that is unused.
Handle SIGHUP by restarting myself.