Ensures test deps are only test deps

Also adds support for outputting pom.xml file.
However, output pom.xml file still has test
deps, and it only needs compile (actually, runtime)
deps. Fix this.