Updated dependencies and refactored tests a bit.