Clean directory in tests using node to avoid cross platform issues

In the integration tests, don't run commands directly with exec for things you can do with node.