Committing a bunch of crazy changes. Will sort these out in next commit.