Added proper logging, verbosity levels, and other refactoring
Thanks to maxme for the help on this!