Moved session and flash messages into res.locals, fixed flash messages not displaying properly