Convert model and component to JS utilities

The code I’m using works fine. It’s the creation of this code that I’d like a utility for.

var allModels = []; var currentTimeEntryModel = new skuid.model.Model(); currentTimeEntryModel.objectName = 'Time_Entry_CB__c'; currentTimeEntryModel.id = 'CurrentTimeEntry'; currentTimeEntryModel.recordsLimit = 1; currentTimeEntryModel.fields = [ { id: 'End_Time__c' }, { id: 'Start_Time__c' }, { id: 'Unique_Time_Entry__c' }, { id: 'Unique_Time_Entry__r.Name' }, ]; currentTimeEntryModel.doQuery = true; currentTimeEntryModel.conditions = [ { enclosevalueinquotes: false, field: 'End_Time__c', inactive: false, name: 'End_Time__c', operator: '=', type: 'blank', value: 'null' } ,{ enclosevalueinquotes: true, field: 'Time_Entry_for__c', inactive: false, mergefield: 'userid', operator: '=', originalInactive: false, type: 'userinfo' } ]; allModels.push(currentTimeEntryModel); // Initialize each of our Models // so that they have index maps created // and other internal guts, // then register them with Skuid // so that Skuid officially knows about them $.each(allModels,function(){ // Register each of our Models with Skuid this.initialize().register(); }); // Load all Models --- this will: // (a) populate all metadata // (b) run the queries on the models skuid.model.load(allModels);<br>