Replaced 'eval' with twisted JSON parser.
cleaning
Reformatted to encapsulate variables in a closure
Added licensing condition