I'll have to let someone else work on this, it's way too complicated for me. There's a million little assumptions in the codebase, Module has a srcfile of type File and it expects this to be a valid file. It either reads from it, or copies it's file name and reads from a new File, leading to crashes everywhere when a file is not an actual file. You'd have to litter everything with booleans, or re-engineer the whole class. None of this is trivial.

Anyway that's precisely why I've initially implemented this as reading from an actual file, because it touches very little code.