refactoring tweaks

 - template env as a registry member
 - partially apply move_on_error
configuration and improvements for sync

 - wait until proper files are available to avoid a race condition
 - configuration vars