Test infrastructure in makefile and run_tests.sh, as well as test for optimised implementation of random_in_range.