Fixed issue #10 and #11, updated to JQuery 1.9.

Updated the code to JQuery 1.9 keeping it compatible with 1.8. In
addition fixed issue #10 and #11.