added support for passing the debug port through in arguments - also add...

...ed unit tests