Fixed a bunch of broken stuff, redid the template hierarchy (hence the bulk of the changes), made the documentation use its own template (for the GFM), made the PHP use its own template (because seriously, that makes things a lot easier).