use a context processor and a bit of refactor

Refactor a bit plus use a context processor for the site-wide "is_moderator"