greatly simplified code

rewrote curry() as a non-recursive function with a single eval call.