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.
Please use `if (input.hasOwnProperty('length')` (to be more strict)