fixes #1646, #3103 - enable cloning for templates, and add read-only options

Use `Foreman.in_rake?` instead.