Direct measurement of ultrafast temporal wavefunctions