Major refactoring on CodeFormatter

1. Ensure all code paths covering integrateComments
2. Create a function for each duplicated code fragment
3. Use better string replacement functions
4. Rename vars and normalize comments to //
Some other changes on CodeFormatter