Various code-rearch for future flexibility.

cp conf file templates to directory then use sed -i instead
of redirecting w/o -i option.

create variables for pre/post file names of conf files.