refactor main.py, flesh out functions from main function

@stdweird, @wpoely86: please review?

The diff is going to look a bit messy, maybe you want to look at the actual new `main.py` instead...
this is a mess wrt indentation: maybe do
```
if not orig_paths and from_pr:
   ... (and return?)
elsif orig_paths and easyconfigs_pkg_paths:
  ... (2nd block)

return [(path, False) for path in orig_paths]
```