Added templated xorSwap and a templated swap with a temporary variable.