HTML document throws better errors when there is no root node

HTML documents have lax parsing and can be created even without a root node. This results in errors when the document defers methods to the root node. This patch catches that circumstance and throws more descriptive errors to let you know what went wrong.
Merge pull request #266 from polotek/handle-empty-doc

HTML document throws better errors when there is no root node