Adding tests & improvements of random string generation