Proxy __len__ and __contains__ for LazyObject

Regression test and patch for ticket #20924.