Moved time seed generation inside the key generator function.

That way multiple keys are never generated with the same time seed.
Updated tests