Lots of changes. This commit is out of control. Sorry.