Tweaked the PHP to serve up static HTML files for the top and bottom, which don't change.
Oops, forgot to add bottom to last commit.
Added a python version with what should be identical output to the client, though much more verbose on the server.