When checking whether a node is root, don't rely on the parent node existing.

Happens frequently that one selects a node, scrolls away multiple sections,
and while that node is loaded (because it is selected) with the rest,
its parent won't be.
goprevbranch needs the event as argument.
Added pillow==1.7.8 to pip-frozen, to include PIL.