A new tool to generate testdata.

./tools.py bla maketestdata dir courseid
bla can be anything. It is the config used by other commands.

Also, I corrected an error in the indexhandle, which didn't caused any error. Strange.