Improve and fix the description of gen_stitching_macro_code().
Use package directory to look for macro templates.
Write macro code as well.