Ignore Rsandbox directories.
Remove incorrect distance calculation.
Factor out _calc_test_short_dir.