Function normalizeForSerializationScope

Traverses an object and normalizes it for serialization in targetScope.

  • Converts all PrecisionValue fields so scoped is in targetScope
  • Rewrites PrecisionValue value from the computed scoped value
  • Rewrites scope / mainScope string fields to targetScope