Add API + tests for Swarm

`mkdtemp` imported but unused