First stab at new template rendering in php

This takes a few shortcuts, but is a proof of concept getting
the new frontend into php. It requires a few patches to
lightncandy which are also in gerrit.  They arn't seen
as dependencies directly to simplify rebases and changes
to those patches.

Change-Id: Iff47388bffc5b40015dd3a7db010d99600050b35