Review/javascript validation stuff

Basic thoughts on the JS code you asked for feedback on.

1) Don't pollute global namespace (can use things like requirejs, or methods similar to what I did in cb93072).
2) Use things like underscore (instead of bothering to roll your own) for basic functional programming 
3) I see no value in generally using "new functionX()" if you are just trying to create an object that has a few fields on it.  Easier to just return a new object literal, as I did in ec2fdc0.