Use ensure_packages() to prevent collisions

ensure_packages() would introduce a dependency on stdlib, but would help prevent collisions.