replaced eval with much safter ast literal eval

This should remove the severe security risk of evaling data that is possibly user provided. It uses the ast module from the standard library.