added a number of derived fields to the models in models.py
also ran validate and cleaned up some errors in existing code