creates asMutable method on Immutable arrays and objects.

accepts a deep flag to force a deep conversion for nested objects.