Quoted `class`, as it's a keyword in upcoming versions of JS.
Complete rewrite. NO MORE JQUERY.