Provide has() method to Document

This will provide a way to test for the presence of a fragment, and prevent the "Undefined variable $single" error that's thrown by the get() method when the fragment doesn't exist.