Move metric validation and row key generation to TSUID

This is not a good permanent solution. It's just a straight extraction of a few methods to make them reachable on a few parts we're working on.