Make microlint complain about unresolved references.
Make name and reference lookups case insensitive.
Replace nub . sort by a more efficient nubSort.