add the ability to specify a parent object instead of always attaching to window.