Added lots of tests, tweaked methods, added test files