Chenged context_processor to template_global and some PEP8 fixes

I changed context_processor to app.add_template_global. context processor adds more complexity to request pipeline, template_global is injected in jinja level.

Fixed "line too long" and "space before operator" PEP8 errors.