Messages framework

Use Django's messages framework to replace some workarounds.