Doing the right thing

jqueryized it... underscored it... and added tests. It's more robust now, and should be much cleaner