SwapTable implementation using templates. With tests.

no nweline :D