Move configuration into database and added a config page