Turn on shallow_clone for faster build start

MSP-11587
Move before_test into test_script

MSP-11587

It appears that before_test is not used when test_script is given, so
move before_test lines to beginning of test_script instead.