Refactor guardian as dissused in this topic https://meta.discourse.org/t/so-you-want-to-help-out-with-discourse/3823/41?u=hunter

Creates a mixin for the ensure_* functions and creates seperate mixins for functions dealing with posts, categories, and topics.
Merge pull request #1815 from PatrickHunter/master

Refractor guardian as dissused in this topic https://meta.discourse.org/t/so-you-want-to-help-out-with-discourse/3823/41?u=hunter