DRY up random key generation

Remove key generation responsibility from ActiveRecord classes
Use uuid for key generation
Merge pull request #2035 from bluerogue251/dry_up_random_key_generation

DRY up random key generation