Allow formatSelection to return a DOM or jQuery element

Instead of coercing all results of `formatSelection` into a string, check to see if the function returns a string or a jQuery/DOM object.  If that's the case, just insert it directly into the DOM.

This allows users to return more complicated objects, with event listeners, etc. attached.