Handle primitive types consistently

This change ensures that any time the factory is called with a primitive type, the primitive value is simply returned. This behavior was previously inconsistent between different primitive types (e.g., `false` would return `false`, `null` would throw an error, `undefined` would return an empty *ImmutableObject* object). See the commit message for details about the changes.