JS version of derive_cred
Move generate_ids to Tool_credgen
Fix random number generation

Words and strings were mixed up...
Complete binding of Tool_credgen