Use implementation by ryanplusplus.

cpputest commit #503480b0f9555cbbe6be3f8aad65cf685b5d4308.
Some additional tests.
Some additional tests.
Correct function order.