Update index.php

Clean up the code (deleted all the commented parts)
Fix a bug with subdomain
Added priority to hooks