REFACTOR: How esp paks are generated.

Moved all modified content into template directories to avoid overwriting user changes.
Refactor esp.c to cleanup template generation.