Substitute deprecated size() method

jQuery deprecated the [size method](http://api.jquery.com/size/) with version 1.8. To prevent from throwing errors that occur when using a custom jQuery build (without deprecations) this commit substitutes the size method with the length property as recommended  by the jQuery docs.

As length is a native js property on lists, this change is backwards-compatible.