Complete CFG overhaul

redid every cfg, most function the same, but are written in a way better
method. All scripted by me of course.