Handle PHP data through filters to avoid lxml/mako interference

Partially fixes #1375. Still need to force the filter for .php.
flake8 part 1

[ci skip]
flake8 part 2 + style changes

in two parts because I’m too lazy and using the one-file-at-once GitHub online editor.
Force php_template_injection filter on .php output

Issue #1375
Check for keys
Promote a different default filter
flake8
Checksum PHP source files to ensure they regenerate
Merge pull request #1376 from getnikola/php-templates

PHP templates fix