Work in progress on streamunmarshalling arrays. Also includes other minor changes.