(bug 43990) Object conversion for diff arrayalisation.

This adds a way to convert objects to and from arrays on the fley,
so they can be used in an array representation of a diff.

This would allow us to implement I9fd62298 more imply and elegantly.

Change-Id: I0728282d16e093ccb202471da701fa44b78e991f