MessagingViewModel tests

Added tests for the MessagingViewModel
Refactored the MessagingViewModel to make the success message
auto-dismiss functionality more testable.