Several improvements

Hi. Thanks for a very nice tool. I forked it and added a bunch of features and bug fixes to accomodate my needs. I also took the liberty of selecting Apache as the license, since nothing was said about licensing. Please see CHANGES.md for full list of improvements and bug fixes.

Hope you will merge the changes :)

Jan