Limit Theorems For Random Exponential Sums And Their Applications To Insurance And The Random Energy Model