Massive refactoring of sample intersection. Some comments added. Sequential intersection is now contracted based on pairwise intersection matrix.