Move the resume token creation code to the relier, add more tests!