Improve settings page and move some config parameters to the database