Merges alias and function counting. Some cleanup.