Update README, refactor some, add more tests.