Rewrote index.php to work with the new structure.