Cleaned up math.F90 with implicit none's and docs.