Refactor main function

This splits out the finding of files (mainly the Git commands) from the
completing read itself. This means one can use the function
`magit-find-file-files` in other places (eg Projectile).