Issue #1017: Making "type" an argument in ObjectResult's constructor.

...redType is always set when Serializing the output.

Serializing cannot use RuntimeType because - There is a possibility where the output Object can be null in itself. The type cannot be determined in that case and Serializer cannot be created. In that case if DeclaredType is also null, then the Serializer will have no option but to throw. Adding the "type" to the constructor will make it more obvious for the developer to set that when creating an ObjectResult.
Added functional test to verify the case when both type and data is null.
don't throw, let this return null and let the formatter handle null (by not writing anything or if there is a reasonable way for writing null, let's do that. By reasonable I mean that it can be serialized back to a null object of the same type).