Move base functions, admin, and frontend into separate files. Modify index.php to only load required files for the area we're displaying