Added testing stubs and basic tests for selection functions.

Also: Changed warning to stop to be able to test this behavior and block calculations when input is wrong.
Also: Extended random selection to handle scenarios in which we want to select more elements then they are in population.