Removed unsupported dict comprehensions

No features post-python-2.6 are used, other than dict comprehensions.
This commit removes them so the LRS can be run under python 2.6.
Changed comprehensions to use the dict constructor
Fixed syntax errors
Made UUID generation code compliant