Detect url or html based on URL.parse #622

Address edge cases in URL vs HTML detection in  config.html parameter.
Added test case showing html fragment which was previously incorrectly
detected as a URL, which was throwing errors.