add some options to random_alnum

(completely rewriting it in the process and adding tests)