add a length filter that works for objects as well as arrays and strings

A minor convenience, but still nice to have.

There was some previous discussion that indicated that such a thing would be a welcome addition (https://github.com/paularmstrong/swig/pull/335) but that looks to have stalled a while ago.
Good point. An empty string? It'll just render nothing if referenced directly and it will be falsey if used for logic.