Added support for flattening sparsely populated array values when the value true is specified for the optional allowArraysNodes parameter. Added unit test cases to verify behavior in the to and from methods.