Unify custom_boost_factor, custom_score and custom_filters_score and add distance scoring

These commits close issue #3423