public static function load_adhoc($mode, $component, $area, array $options = array()) {
        $id = 'adhoc/'.$component.'_'.$area;
        $definition = array(
            'mode' => $mode,
            'component' => $component,
            'area' => $area,
        );
        if (!empty($options['simplekeys'])) {
            $definition['simplekeys'] = $options['simplekeys'];
        }
        if (!empty($options['simpledata'])) {
            $definition['simpledata'] = $options['simpledata'];
        }
        if (!empty($options['persistent'])) {
            // Ahhh this is the legacy persistent option.
            $definition['staticacceleration'] = (bool)$options['persistent'];
        }
        if (!empty($options['staticacceleration'])) {
            $definition['staticacceleration'] = (bool)$options['staticacceleration'];
        }
        if (!empty($options['staticaccelerationsize'])) {
            $definition['staticaccelerationsize'] = (int)$options['staticaccelerationsize'];
        }
        if (!empty($options['overrideclass'])) {
            $definition['overrideclass'] = $options['overrideclass'];
        }
        if (!empty($options['sharingoptions'])) {
            $definition['sharingoptions'] = $options['sharingoptions'];
        }
        return self::load($id, $definition, null);
    }