Correlated wavefunctions for the water molecule