CLIDComps: Fixes for python 3.
Get clid script and tests working with python 3. Fix resource warnings about unclosed files.
The clid script was depending on the hash() builtin function of python. This changed between py2 and py3, so that clid was giving different (and nonreproducible) results.
Now implement the hash function in the clid script.