Added masterPort variable to jam.
Refactoring server to use dynamic port number.