Extract leaf_node_finder into a separate class.

This is part of the cleanup for sr_parser's code before merging.