MDL-27814 blogs: Refactoring code to use proper context and such

Based on the decisions made in the issue, most places in blog should use site context.
There are also minor other refactoring to support all changes made in the issue.