Working version uploaded.
JS completely reworked and abstracted out.