Implement some of upoopia.py. Cosmetic changes to upoopia_lib.py.