Removed jQuery dependancy and refactored player code