tooltip: fixed bug in overlap-checking code, added content-toggling tests to demo