Overhaul of function names. Move some functionality to EGRET.