made PersistentArray into a functor

The previous implementation was carrying around a function in order
to do initialize new elements of the array, when it grew.  Thus, you
couldn't put persistentarrays into hashtables, because polymorphic
equality fails at runtime on function values. (Of course, it may not be
a great idea to put stuff in a hashtable and the mutate it ... )