Migration to Jquery plugin - WIP

DO NOT MERGE - Tracking pull request whilst I fix this thing properly!