New Framework using PHP

This is a more secure alternative to the previous version, now using
PHP instead of all JavaScript.