Introduced generic command-line-args-based hook mechanism.
Improved stats and added stats hook (activated by "stats" argument).
Fixed non-keep-alive connection closing.
Fixed bug in client reconnecting mechanism.