Added a "clone object" function, can be useful when modifying variables in a template (which you shouldn't do, but still can happen)