Implemented generateNewToken function, removed functions working directly with html, added unit test for new function