Encoder: Fixed incrementing of reference IDs for arrays, added support for SequenceInterface and AssociativeInterface.