Basic cloning & config.

Also fixed a few bugs and added a few features.