Moved DB initialization into core