A fourth order accurate discretization for the Laplace and heat equations on arbitrary domains, with applications to the Stefan problem