Decompose traverse and traverseChildren into several different functions.

The new functions are as follows:

- findReprints
- findAnyReprints
- findArrayReprints
- findObjectReprints
- findChildReprints

I made these changes to improve readability. They have no real performance or functionality implications.