Defer doesn't make guarentees

Fixes race condition where the defered setup would trigger before the
modules etc finished loading.
Move templates (makes more sense).