Tuples: rework BTreeKey serializer, add common interface