Implement internal / external link counting
Implement internal / external link counting

This code hase been heavily optimized but still takes some time, because the
number of links is usually more than 5 million per wat file.

klemens/ALI-CC,klemens/ALI-CC,klemens/ALI-CC