jQuery encapsulation

Changes for jQuery encapsulation to replace global $ with local scope