Added most of the DB stuff for the wizard.