Fixed clone function; Added groupBy object.

Fixed the clone function to accommodate Dates and Arrays.
Added the ability to group by objects, as well as primitive types.