Add log before exit.
Add connection statistics, closes #9