Use $.contains(...) to detect that element was added to DOM

HandsonTable must be rendered to an attached element to work properly,
however Bokeh requires its widgets to render to detached elements.
Previously, to detect if an element was attached to the DOM, we used
display CSS property and waited for it to change its value. This is
unreliable and doesn't work in (at least) FF.
Merge branch 'master' into mattpap/fix_ht_render
Merge pull request #1233 from ContinuumIO/mattpap/fix_ht_render

Use $.contains(...) to detect that element was added to DOM