Changed $ to jQuery and add hasOwnProperty

Here is the changes for $ -> jQuery on the 2.5 branch and the code for hasOwnProperty in the (for in) loops.
(Sorry these were supposed to be separate pull requests; but somehow I managed to commit to the same branch... LOL)