ranges: better handle overlapping ranges
ranges: better handle overlapping ranges

This tries to merge together overlapping ranges. There is still at least one
edge case that is not handled though (new range fully contains already added
range), which requires range removal functionality.

ghedo/pktizr,ghedo/pktizr,ghedo/pktizr