Moved a bunch of install logic in to its own class

This is mainly to allow running a headless install, but it also makes the code a bit tidier and easier to work with.

It's a long time since I've done anything with FluxBB. Does this seem sane? Does it break anything that I've forgotten about?