Refactor base.html, add messages infrastructure