bin_data function

Function to bin data based on a vector of bin separators, e.g. for use in VPC