Fix JSON circular reference handling

Fix problem with the JSON emitter that caused JSON::Syck to
complain about circular references when it saw the same object
twice.

Added the $JSON::Syck::MaxDepth flag with a default value of 512
Merge pull request #6 from bdraco/master

Fixed JSON circular reference handling and add tests