Porting/extending PyGainz to a PHP web app (for fun!)