Master for merge

All the tests work now and I think this branch is ready to merge.