Fixed memory leaks in the function for registering parsers

The server test now accepts the command line parameter -p to specify the port to bind to