Add default value for agent port.
Add method to actually read from the agent port in the server loop.
Add very ugly test for the agent part (only stopping the application).