Fix dependencies, add some tests