Refactor added jQuery dependancies and organised code.