Make flash message support more types and add test cases.