Ex Vivo Cortical Circuits Learn to Predict and Spontaneously Replay Temporal Patterns