Fixed two jQuery plugin issues.

This is a backport of a fix that was made in tinymce 3.5b3.

> Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2.
> Fixed so encoding option gets applied when using jQuery val() or attr() to
> extract the contents.

I noticed that $('base').attr('href') was returning an object instead of a string, which led to hunting it down and discovering that it is an old bug.

https://github.com/tinymce/tinymce/commit/5ed576da97bce7d2212fb9a80f2ab2c4509d21ba
http://bugs.jquery.com/ticket/11527