ENH: moved cmdgen to tools