Minor cleanup of code

Standardised indentation, comments.
Changed swap.
Added nrm2 to export.cpp