[CHECKPOINT] Continuing work on elf file type support.

Finished the routines that allow elf file validation and enhanced
the elf data structures. Minor changes to common.c and .h
[CHECKPOINT] Various refactors on the elf datastructures.