Fixed a libtidy related crash on Cygwin
Added function for printing errors
Reimplemented argument parsing to use getopt_long

instead of argp which is unavailable on a lot of platforms