Add ability to pass extra parameters to during tests. Limit distance table search so that it doesn't return any big components if they're beyond max_distance.