REF: Add recursion depth for keys, mapping to nested keys rather than just key value
REF/ENH: Add nesting recursion code and tests