added port and debug command-line options. 

With this change you can enable a debug mode on the command line which prints all log messages. You can also specify port number.