rewrote the object loop to only deal with top level values

anything deeper than the top level of an object will not be unserialized or search-replaced.

This should resolve #792