Added option to sort points to optimize for cache

Added option to sort points to optimize for cache locality instead of
maximizing information added with new points. Set sorting_buckets option
> 0