Added Doctrine, moved some bootstrap code around