Implantation and erosion of nitrogen in tungsten