Finished rewrite of JavaScript and associated validation methods