Mean curvature flow of graphs with free boundaries