Fix #35.

Make sure any class with a virtual method has a virtual dtor. Also a
few other cleanups.