Logging changes

I used the logging module to print debug messages to stderr so you can pipe the final results to a file without parsing

If you want I can remove the verbose flag also if you like this style.