erlc: fix a bug in handling of files to compile first

If a file that is depended upon itself depends on other files, make sure
those are compiled first. While at it, rename variables for correctness.

Reported-by: David Robakowski
erlc: prepare clean FirstFiles

Make sure that FirstFiles has no dupes and preserves the proper order.
erlc: extend dot_erl/3 comment
erlc: relocate helper function