Cleanups and some work on Pari