Removed unneeded classes

The trick for the closure to return a value is to use a mutable object
and a dictionary works just fine, there's no need to define classes on
the fly. Also, None is already a singleton, so there's no need to create
a new class that means no result so far.