Refactored affected code by the introduction of the treehandler class

The clickTreeCell() function is used in 3 files, so a refactor was needed
to reflect the introduction of this new class which encompasses the
clickTreeCell() function.