Used log instead of alerts.
Extract listener classes and message classes.
Fix default port.