 Zotero.BetterBibTeX.keymanager = new class
   constructor: ->
     @log = Zotero.BetterBibTeX.log
-    @journalAbbrevs = Object.create(null)
-    @journalAbbrevsStore = {}
+    @resetJournalAbbrevs()
 
     @keys = Zotero.BetterBibTeX.Cache.addCollection('keys', {disableChangesApi: false, indices: 'itemID libraryID citekey citekeyFormat'.split(/\s+/) })
     @keys.on('insert', (key) ->

    return unless key
    return unless Zotero.BetterBibTeX.pref.get('autoAbbrev')

    @journalAbbrevs[key] ?= Zotero.Cite.getAbbreviation(null, @journalAbbrevsStore, 'default', 'container-title', key)
    return @journalAbbrevs[key]

  extract: ->
    [item, insitu] = (if arguments[0]._sandboxManager then Array.slice(arguments, 1) else arguments)


  reset: ->
    Zotero.DB.query('delete from betterbibtex.keys')
    @resetJournalAbbrevs()
    @keys.removeDataOnly()
    @keys.removeWhere((obj) -> true) # causes cache drop
    @keys.flushChanges()
    @scan()

  resetJournalAbbrevs: ->
    @journalAbbrevs = {
      default: {
        "container-title": { },
        "collection-title": { },
        "institution-entire": { },
        "institution-part": { },
        "nickname": { },
        "number": { },
        "title": { },
        "place": { },
        "hereinafter": { },
        "classic": { },
        "container-phrase": { },
        "title-phrase": { }
      }
    }

  clearDynamic: ->
    @keys.removeWhere((obj) -> obj.citekeyFormat && obj.citekeyFormat != Zotero.BetterBibTeX.citekeyFormat)
