Fixes bug when using with Ember.js, which decorates the Array class

Changes allowedUnits loop in setPosition method to a traditional for loop to avoid iterating over prototype properties if the Array class has been decorated by another framework or plugin (such as Ember.js).