Adds extend to clone javascript objects