Detect jQuery version

Fixes #121 
Plus the rebase is wrong as you case. It has unrelated changes.