Simplified pretty printer; circular reference detection.