Fix for new jQuery versions: Added removed functionality.

If jQuery version is >= 1.9 add browser detection functionality from
jquery-migrate.

Sorry for the bad diff, changes start at line 129 and end at 165.

P.S.
Someone should create the minimized version.