Add JsConfig.MaxDepth feature to prevent cyclical dependencies. fixes #331