Add support to newer jquery versions

This is an attempt to fix compatibility issues with the newer versions of jquery in issue #85.