Dynamic generation of PHP

Generates the sheet dynamically, and (although it's currently not
visible) print support.
Steps toward #15, #3, #18 (kinda),