Add API + tests for Swarm

`rmdir` imported but unused