Cherry pick from c86fb5a (max-depth option for dictizer)