Enhanced stub generator.

It can handle multiple files at once
and provides better error messages.