Optimize and add specs to Mix.Task module