Dramatically speed up DEP-11 file generation process, and fix bug #16

Not sure if the bugfix is really the best way to do it, but it is
working and working much faster than before.