Add hooks.php and it's alias
Fix misc type castings throughout project
Update debug functionality