Add support for recursive add.

Patch by Ryan Faulkner with modifications by me to support recursive
add.