title: Push() not working when called from inside getJSON()
body: <p>I'm currently using the jQuery drag and drop <a href="https://github.com/kevinchappell/formBuilder" rel="nofollow noreferrer">formbuilder plugin</a>. Now, I want to fetch drag and drop elements from my database and add those element to my drag and drop builder.</p>
  
  <p>This is my request function:</p>
  
  <pre><code>function getElements(){
      $.getJSON( getContextPath() + "/api/elements/get", function (data){
          $.each(data, function(key, val) {
              addElement();
          });
      });
  }
  </code></pre>
  
  <p>Now, I want to add them to the formbuilder instance (I use <a href="http://formbuilder.readthedocs.io/en/latest/formBuilder/control-plugins/" rel="nofollow noreferrer">this</a> example and I use some pre-defined values):</p>
  
  <pre><code>function addElement(){
      if (!window.fbControls) window.fbControls = [];
      window.fbControls.push(function(controlClass) {
          console.log("HERE");
          class controlStarRating extends controlClass {
  
              static get definition() {
                return {
                  icon: '',
                  i18n: {
                    default: 'Star Rating'
                  }
                };
              }
  
              configure() {
                  this.js = '//cdnjs.cloudflare.com/ajax/libs/rateYo/2.2.0/jquery.rateyo.min.js';
                  this.css = '//cdnjs.cloudflare.com/ajax/libs/rateYo/2.2.0/jquery.rateyo.min.css';
              }
  
              build() {
                return this.markup('span', null, {id: this.config.name});
              }
  
              onRender() {
                let value = this.config.value || 3.6;
                $('#'+this.config.name).rateYo({rating: value});
              }
          }
  
        // register control
        controlClass.register('starRating', controlStarRating);
        return controlStarRating;
      });
  }
  </code></pre>
  
  <p>Unfortunately, my <code>console.log("HERE")</code> is not called, so it seems like it alle stops there. The weird thing is, if I use this as my request function the function is properly executed:</p>
  
  <pre><code>function getElements(){
      var allElementsData = ["test"];
      // $.getJSON( getContextPath() + "/api/template/get", function (data){
      // });
      $.each(allElementsData, function(key, val) {
          addElement();
      });
  }
  </code></pre>
  
  <p>What is the problem?</p>