A bunch of variable and function renaming, to make them more sensible.