id serialization correctly returns null for null or undefined id values ...

...rather than 0.

Currently if an id is null, it's being serialized to a value of "0" where it should be maintained as null. This change also pushes the serializing of undefined id values into the same spot where it was previously being done in the addBelongsTo function within the serializer.