Minor improvements

Better comments, got rid of IEAF parameter exports since it is not used,
use root variable in scoreElement since it is used by several statements
in the function, simplified getImageArea, shortened exposeAttributes,
removed safeGuard from pruneEmptyElements