Display flash messages in layout

This will need extra UI magic. Extracted from `frontend`.