fix script structure errors
fix template structure errors
update home page scripts and templates
fix faulty account index template
fix errors in init.php
fix redirect and template/script structure issues