Update index.js

Realize the URI/HTTP/HTTPS/Web validation
Update index.js

The check function now return false or URI if it valid.
Update index.js

Optimize the isWebURI() function
Update index.js

Function isHttpURI now accept the allowHttps parameter.

Rewrite code to use new functionality
added changes of MykolaPrymak, and fixed jshint errors