Added travis config
Moved listen into its own method
Added tests