Modify contains comparison to ignore missing keys recursively

I modified the contains function to ignore missing keys at all levels of the object tree, instead of just the top level. I added tests for all of the odd scenarios I could think of.