Fixing things to work with b5 dev tools. Some things got cleaned up, but there are some strange oddities here and there with mutability/etc.