Rewrite damn near everything

What wasn't changed?