Database/AppData initialization routine