Rectifiability and perimeter in Carnot groups of step 2