Duplex Numbers, Diffusion Systems, and Generalized Quantum Mechanics