Fix some errors.

Fixed some errors against jQuery 1.10.x.
- toArray is not a function
- Failure to follow Same Origin Policy, causing security error

I still don't think that it is all working, and I ended up not actually
using it in my project.