First small pull addressing ancestor checking, more to come

This addresses that one bug that I'm too lazy to go find and link to. See second commit log for details. 

I will try and continue working on this, adding/continuing some requested features.