Added Id Referencing to the toJson function

Provides the option to use Id Referencing in the toJson function by setting the idAttribute parameter.  If idAttribute parameter is left undefined, the toJson function will use JSONPath convention.  This allows Dojo's toJSON function to be compatible with JSON.NET.