Removing dependence on JQuery (it was only a $.each function). But that meant I had to add a new function to create the closure.
Doing proper unit tests now.