Start support for formatters and output redirection.
Implement and use print formatter.
Add CSV formatter.
Correctly set output file on -o.
Add signal handler and destructor to properly close files and sockets on exit.
Switch the order of arguments in foreach macro.