Make parsePath static, change processSpec, add tests for it