Add debug argument (-d or --debug-folder)

When given a directory, it writes the generated SQL that can be used
for debugging purposes.

Change-Id: I1a7a88bb7266cbc6d67a0da50e40d5a15361e2cf
Merge "Add debug argument (-d or --debug-folder)"