Refactor code & fix tests

Fix some tests to work with new API.
Fix cloning of MultiKeyValue that did not do proper deep cloning.
Disable cast warning in DefaultHost.