Make a bunch of properties readonly, remove unused stuff, fix tests.