Work on #394 - this moves token creation (and saving) from doing it all at once, to doing it one at a time, when it's needed. Will database connectivity be a problem?
Merge branch 'bugfixes-6_5_2'