Changed to using SHA512 for secure tokens

Changed tests to use SHA512 instead and then changed the code to use it, too.