Refactor the code to move generic binary tree related methods to a header file.

Moved the "handle_input" and "find_node" methods to a header file and
added more detail to their names to avoid collision.