Improve HTML5 parsing when HTML5Lib is unavailable

It's now no longer necessary to pass in an option to
use the XML parser, it'll happen automatically if HTML
parsing fails.

Also added comments and minor refactoring.