public function library($pathname, &$caller = false, $exposeToView = false) {

        $name = $this->getName($pathname);
        $path = $this->getPath($pathname);
        
        // If a reference to the calling object was passed, set an instance of
        // the library as one of its members.
        if ($caller) {
            
            // If no namespace is given, default to Cora namespace.
            if ($this->getPathBackslash($pathname) == '') {
                $lib = '\\Cora\\'.$name;
            }
            else {
                $lib = $pathname;
            }
            
            $libObj = new $lib($caller);

            // Set library to be available within a class via "$this->$libraryName"
            $caller->$name = $libObj;

            // Set library to also be available via "$this->load->$libraryName"
            // This is so this library will be available within View files as $libraryName.
            if ($exposeToView)
                $caller->setData($name, $libObj);
        }

    }