Cleanup of dict versus array logic
reorganized dictionary/array serialization