make "defines in" work for implicit definitions; should also fix issues
with cases where the name comes after the subterm it is defined in