some initial moving/renaming for clarity
Smoothed everything out. Tested working on 2.1b1 and 2.0.18.8