Packbuilder: compilation fixes

Don't name the return values, as they conflict with the names we want
inside and the types don't match what we want to have inside. We need
them to be two-way channels in the function, and then pass
unidirectional references to the different functions.
Reference: adjust to iterator changes

The Library's iterators now can return either the reference or the
reference's name. As the name is what we're set up for, rename the
functions appropriately so we compile against altest development.