Add API + tests for Swarm

`rmtree` imported but unused