Add XSS Protection to Flash Messages

As well as some other minor changes.