Refactor

I've refactor'd the code to simplify it. It removes 58 lines of code from `clone.js`, and takes away a lot of the duplication between circular and non-circular processing. I also added another unit test to make sure prototypes are being maintained... as I refactor'd purely based on the unit tests, this was taken out of the first commit.