Clean up dendrogram component
Made some changes here to the structure of the dendrogram component. It should effectively work and look the same as it does already, but I did some reorganizing of the javascript code and created some new functions to make it cleaner. This will make it easier to modify as we work towards the MVP.
To review, ensure that it build locally and works the same as it does currently.