Modularized code.
Main procedure renamed to apexir2sheet.