better way to close JS
handle more errors
turn on JS before checking redirects + refactoring
Merge pull request #6 from CERT-Polska/#5

Issue #5: StackOverflow when processing http://legosp.net/