Move utils to separate file
Fix broken `cond` and add tests(!)