fix Module#ancestors and update test
Merge pull request #1211 from skandhas/pr-fix-Module-ancestors

fix the behavior of Module#ancestors