More data cleanup
Use 'names' fields in ini files instead of looking up names in names.txt
Remove useless getCompFromResName()
Remove useless statRefStart(), statType() and componentType().
Fix two memory leaks
Fix possible crash bug, remove useless casts to const chars, and remove duplicate macro getStatName().
Add results from Cyp's code review