Circular data & cross references #110

Adding an option (checkDuplicates) to catch circular and cross
references, disabled by default so as not to slow down any existing code (only a few bits of code are still executed when the option is disabled).

Implemented following @puzrin suggestion that is: do a first pass to get the duplicates, and then put the aliases inside the algorithm. Slower than @larkox 's implementation, but perhaps easier to maintain.

Also added a related test.

NB: There may be some unused aliases if a duplicate is found inside a custom type, which must be a pretty rare case.
The right answer is - do benchmarks and select one that is faster.

`typeof object[key] === 'undefined'` should be optimized very well. But object itself will fall into dictionaty mode, if too many properties added after creation. I can't say without benchmark, will `.indexOf()` be faster or not.