Use JQuery to parse the fragment before posting. refs AONTOOLS-43

Doing this lets JQuery sanitize the input somewhat. For example,
it will close any unclosed tags. It's not quite ideal because we
are POSTing a different fragment than what the user entered but
it fixes the problem of trying to load invalid fragments which
doesn't really work.