Clean up repo and fix some tests

The repo is a mess, doesn't ignore any of the correct files and the permissions are all wrong! This fixes all that. I also got the test cases to compile and fixed a few of them.