Clean up code in model.py, derive.py, and setup.py

This commit removes only uncommented old code from derive and model.py and uses the new FileNotFoundError from the compat module.