Moved dependency resolution to a plugin, fixed cascading package removal.