make listening port a parameter; rename .domain to .domainname due to event emitter conflicts