large refactor + tests

See commit messages for more details; ping me if anything doesn't make sense. One thing I neglected to mention in the commit message is that I also added `hash` and `isequal` functions for Phylogenies (mostly because it helps with testing, but also just good to have in general).

P.S. `julia runtests.jl` to watch the tests pass!