Use alloc in with_capacity; simplify from_iter