Add a way to clear the gateway set on an object.
Better handling of passed in parameters.

When fully loaded object were being passed into functions, they often
got wiped out. Now they can be returned from the cache.