Adding 'shutdown' functionality to messenger.

@sashah87