Move more bootstrapping out of index.php