A Mathematical Theory of Stochastic Microlensing I. Random Time-Delay Functions and Lensing Maps