Various refactorings, commenting, and bug fixes

Bugfixes:
Missing URL start (http://)
Not printing remainder of line that contains a URL
Not exiting on some error situations.