use index for circularReference
differentiate circular references
moved indexOf below other types checks
Merge pull request #11 from esco/master

differentiate circular references