function destroyInstance (instanceId) {
  var instance = instances[instanceId];
  if (instance && instance.app instanceof instance.Vue) {
    instance.document.destroy();
    instance.app.$destroy();
  }
  delete instances[instanceId];
}
Destroy an instance with id. It will make sure all memory of
this instance released and no more leaks.
@param {string} instanceId