Add test suite and a bunch of tests The tests aren't complete yet, there's still a lot of cases that aren't covered.