function corePreferences(k, v) {
  try {
    if (v === undefined) return _storage.getItem(k);
    else if (v === null) _storage.removeItem(k);
    else _storage.setItem(k, v);
    if (_listeners[k]) {
      _listeners[k].forEach(handler => handler(v));
    }
    return true;
  } catch {
    /* eslint-disable no-console */
    if (typeof console !== 'undefined') {
      console.error('localStorage quota exceeded');
    }
    /* eslint-enable no-console */
    return false;
  }
}
@param {string} k
@param {string?} [v]
@returns {boolean} true if the action succeeded