Added tests for _create_local, and extracted libvirt calls for testability