Changes for serializing Array provenance correctly (issue #4)
Code cleanup and refactoring
Accounting for the case when an item of the array is another array.