The heaps process, libraries, and size-biased permutations