A finite element method for free surface flows of incompressible fluids in three dimensions. Part I. Boundary fitted mesh motion