Add lastError() method
Add redirect & debug mode to test.php