Factorization of the photoion and lookuptable routines.
Tested against the unfactorized version.