Fixed atmospheric extinction function.

Lots of little changes to the extinction function and added comments for
clarity across the board. Still need to implement alpha for aerosol.