Created a separate controller and service

The new controller and service implement the logic of SignalR
communication in a better way, using $rootScope.$emit and $rootScope.$on