Ultrafast optical processing with photon echoes