Fixes #746 - Generate all the Host template when click on Build to avoid...

Generate all the Host template when click on Build to avoid errors during installation.
Includes moving of template_used to Managed model so it can be used elsewhere.

a tidy bit more optimized jquery could be:

```diff
 $(function () {
-  $("#build-review").click(function() {
-    $("#review_before_build .modal-body #build_status").html('');
+  var dialog = $("#review_before_build");
+  $("#build-review").click(function () {
+    dialog.find(".modal-body #build_status").html('');
     $('.loading').addClass('visible');
     $.ajax({
-      type:'get',
+      type: 'get',
       url: $(this).attr('data-url'),
-      success: function(result){
-       $("#review_before_build .modal-body #build_status").html(result);
+      success: function (result) {
+        $("#review_before_build").find(".modal-body #build_status").html(result);
       },
-      complete: function(){
+      complete: function () {
         $('.loading').removeClass('visible');
       }
-    })
+    });
   });
-  $('#review_before_build').on('change', "#host_build", function () {
+  dialog.on('change', "#host_build", function () {
     $('#build_form').find('input.submit').val((this.checked) ? (__("Reboot and build")) : (__("Build")));
   });
 
-  $('#review_before_build').on('click', "#recheck_review", function () {
+  dialog.on('click', "#recheck_review", function () {
     $("#build-review").click();
   });
 });
```