Expose main constructor, fallback on document

This is a similar behavior to jQuery.