Complete rewrite, ditched jQuery