[WIP] Add r_set_cardinality()

This will add `r_set_cardinality` functionality with tests for each layer.
Also here, please modify the test to not only insert 10 element but try several times with different numbers of elements. 1 up to 100 or something.