Added end to end test. Removed some bugs with URL escaping. Added option to choose output file.