adds more tests

also some code tweaks based on some failing tests, whoops!

also also adds some gems to facilitate testing.