Refactored testing, added valid cases
Added collision detection to token generator