Some basic refactoring, input argument validation and progress indication

Hi,

I've added some basic input argument validation, as I noticed some users
not fully understanding how to use the tool and how to deal with the exceptions.

Also added some basic progress indication.