Moved alerts functionality into the alerts directive.