Added database access and config file loading