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.