also properly prepare templating with --job and --regtest
cleanup code
more code refactor
Merge pull request #3 from stdweird/templating_for_job_regtest

cleanup code
fix TODOs
Merge pull request #498 from boegel/templating_for_job_regtest

also properly prepare templating with --job and --regtest