Refactor

Shuffled the functions that I refactored out of the old codebase around
so the ordering made a bit more sense and the click trigger events were
grouped together.

I also forgot to mention that, in the previous refactor commit, I
refactored out the code that determined how/whether a folder in the tree
should expand into its own function. (I forgot to make that its own
commit because I ended up on the phone for a few minutes and though I'd
already done it)

There are still probably a couple of things (at least) that I could
improve through refactoring on this project, but the effort to reward
ratio isn't that great on them at the moment.

Over the last 24 hours or so (only little of that time being committed
to this endeavor), I've broken up a couple of monolithic functions, made
the code base a LOT more readable, got rid of some duplicated code, and
fixed the bug that made me start this whole journey.

I'd call that a win, honestly.