public function addBehavior($behavior, $config = array())
    {
        //Create the complete identifier if a partial identifier was passed
        if (is_string($behavior) && strpos($behavior, '.') === false)
        {
            $identifier = $this->getIdentifier()->toArray();
            if($identifier['path']) {
                $identifier['path'] = array($identifier['path'][0], 'behavior');
            } else {
                $identifier['path'] = array($identifier['name'], 'behavior');
            }
            $identifier['name'] = $behavior;

            $identifier = $this->getIdentifier($identifier);
        }
        else
        {
            if($behavior instanceof KBehaviorInterface) {
                $identifier = $behavior->getIdentifier();
            } else {
                $identifier = $this->getIdentifier($behavior);
            }
        }

        //Attach the behavior if it doesn't exist yet
        if (!$this->hasCommandHandler($identifier))
        {
            //Create the behavior object
            if (!($behavior instanceof KBehaviorInterface))
            {
                $config['mixer'] = $this->getMixer();
                $behavior = $this->getObject($identifier, $config);
            }

            if (!($behavior instanceof KBehaviorInterface)) {
                throw new UnexpectedValueException("Behavior $identifier does not implement KBehaviorInterface");
            }

            if(!$this->hasBehavior($behavior->getName()))
            {
                //Force set the mixer
                $behavior->setMixer($this->getMixer());

                //Add the behavior
                $this->addCommandHandler($behavior);

                //Mixin the behavior
                $this->mixin($behavior);

                //Store the behavior to allow for named lookups
                $this->__behaviors[$behavior->getName()] = $behavior;
            }
        }

        return $this->getMixer();
    }