Import new pi3d, many other small changes