Ruby-like inject for jQuery