Added more tests, safer typing, and a script to run tests