A path-probability representation for wavefunctions