Replace ls with more safe find | read, check for .git presence

I'm not sure how script updating is supposed to work, so this is a WIP.
Created this PR for discussion.