[module, test_tools] Add an option to use regexps in example results.

Add an option to run a test multiple times.
[rand] Add example tests.
Add support for old modules that set example attribute directly.