Allow to generate a random sring
These functions are used in Zed.
This is a new implementation, using closures,
to decrease cyclomatic complexity, and pure
random functions to generate digits or letters
instead to play with arrays of elements.
Test Plan: Unit tests included
Reviewed By: dereckson
Differential Revision: https://devcentral.nasqueron.org/D1629