Add tests, another dependency, and other small code changes