Major performace fix

We didn't check if we reached the most toplevel path in Main while
finding the cabal file, thus taking REALLY much time. This version fixes
that bug.