Rapid programmable 300 ps optical delay scanner and signal-averaging system for ultrafast measurements