PR 1360 revived: Add clamp function

https://github.com/D-Programming-Language/phobos/pull/1360

As original author did not respond to reviewer comments for some time, I have made necessary changes and created new PR for it.
Yes they do - this block of tests is almost a copy from `max` tests just one screen above.