Switch flash messages to use setInterval so it doesn't block tests