made MappedElementArray resize()able. This is important because before,
the whole array was re-allocated, which could invalidate accesses on the
old array. Added lots of javadoc.