function copyProperties(to, from) {
  foreachin(from, function(p) {
    to[p] = from[p];
  });
}
Copies all properties from second object to the first.  Modifies to.

@param {Object} to  The target object.
@param {Object} from  The source object.