Move datadict lookups, set globals instead of using a class.

It is safe to do this with globals. locals has this warning in the
python docs:

'The contents of this dictionary should not be modified; changes
may not affect the values of local and free variables.'
globals does not have the same warning so it should be safe to modify