elf: some cleanup and minor performance improvements.
elf: some cleanup and minor performance improvements.

AlexIljin/factor,AlexIljin/factor,dch/factor,bpollack/factor,dch/factor,bjourne/factor,bjourne/factor,nicolas-p/factor,nicolas-p/factor,nicolas-p/factor,slavapestov/factor,slavapestov/factor,bjourne/factor,tgunr/factor,factor/factor,factor/factor,AlexIljin/factor,mrjbq7/factor,bpollack/factor,slavapestov/factor,factor/factor,bpollack/factor,tgunr/factor,factor/factor,sarvex/factor-lang,slavapestov/factor,AlexIljin/factor,dch/factor,AlexIljin/factor,sarvex/factor-lang,mrjbq7/factor,bjourne/factor,sarvex/factor-lang,tgunr/factor,bpollack/factor,dch/factor,bjourne/factor,sarvex/factor-lang,tgunr/factor,nicolas-p/factor,bpollack/factor,slavapestov/factor,mrjbq7/factor,mrjbq7/factor,mrjbq7/factor,sarvex/factor-lang,factor/factor,sarvex/factor-lang,slavapestov/factor,slavapestov/factor,nicolas-p/factor,tgunr/factor,bpollack/factor,factor/factor,bjourne/factor,AlexIljin/factor,dch/factor,bjourne/factor,bpollack/factor,dch/factor,nicolas-p/factor,tgunr/factor,sarvex/factor-lang,mrjbq7/factor,nicolas-p/factor,AlexIljin/factor