Check for integers before numbers in exponential notation 

This optimization assumes that integers will appear more frequently than numbers if exponential notation. I believe this is a reasonable assumption for most common uses.

I also consolidated a few `when` clauses that all return the same value.