moving over external R functions related to downsampling and conversion to the core bl.biomod R package in order to simplify the r-biomod-wrapper.