Changed the way $.each behaves with arrays and array-like objects.

Callback params are now `index`, `element`, `array`. This means $.each now behaves like the documentation says it should.

Added a unit test for $.each, which was missing.