#594 - Insert field named 'length' not allowed

replaced _.each with for in
in functions set, unset, complete, methods