Last bit of sort_features() refactoring

Optimization/cleanup of (streaming) sparse features
* avoid malloc/re_alloc/copies in sort_features()
* streaming_sparse_features::sort_features() now uses method from sg_sparse_vector
* sort_features(bool stable_pointer) to guarantee that features pointer won't change
* extensive unit tests to fix clone/sort_features (less code & more tests)
* (quite paranoid assertions for sorting/merging code)