Added --debug option and improved logging

Corrected whitespace stripping regex to avoid warning
Removed hard-coded test path