added port and debug command-line options. Also modified how logging is
handled.
Merge pull request #23 from armanhb/cmd_options

added port and debug command-line options.