added support for customizing connection to pm2 daemon

hostname is now correctly is set according to the url. User can change
rpc_port and sub_port parameters as well.