Change to the full <?php header
Make class an optional parameter
Remove some print/echos that litter output

Should be behind a $debug setting