Overhaul define.py, remove test.py