Improve #TEST tag, and randchoice() and srandchoice() functions.

Also change --names behaviour: names appear in filenames now.
Run pdflatex twice if references were found.
Keep track of seed used to generate random values in document.

A .seed file is generated during the compilation.
This file is also attached to the pdf file if pdftk is found.
Several small fixes and enhancements.

- #IFNUM{}{} didn't work
- spaces in directory names lead to compilation errors.
- add [str] flag to #EVAL.