Change key generation in SequenceWrapper.getKey

Keys had the possibility of clashing, this should solve that problem. Unit test added.