Some code cleanup
Move util funcs after testing..
Add more tests
Open path instantly if there's a tab for it