Fix copying objects by using JSON native methods. Closes #36