Optimization for IOMemory's __all_triples. fixes #318

Adding a __contextTriples index allows us to efficiently look-up
all triples in one context at linear cost of the store's size.
This is a common operation for example during serialization.

The previous implementation got along without this index, but
serializing a dataset with a lot of graphs took quadratic time.