Generate the configuration file with a template instead of a bash script

Based on #8

As I need conditionals and loops, I choose to use `underscore` template instead of `mustache` or `handlerbars`.