cpu: Use the swap functions provided by the compiler and operating system

Compilers supported: GNU Compiler Collection and Microsoft Visual C++
Operating systems supported: GNU/Linux, FreeBSD and OS X.

Closes #11