Allow a component to draw outside the document

This introduces the flag _canDrawOutsideDocument that can be set to
indicate the component that it's ok to draw in that state.
Avoid the warning message: "Trying to replace element <div>​</div>​ which
has no parentNode"
Merge pull request #1396 from aadsm/draw-outside-document

Allow a component to draw outside the document