changed test.php
added debug functionallity to insert.php and fixed a number of minor things.