Fix a bug which cause Service's MD5 is not right

This issue because the comments and extra space should not be calculated in MD5, so this change is remove such things when generate "ServiceDefinition".
Change line 66 to make the definition not directly copy from lines.
In the for loop, format each line first then copy to def.