[Refactor] Add a simple program to save debug info to file for debugging
[Cleanup] Correct comment and other minor style issues.