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 figuring out the paths where easyconfigs are installed, i.e. any path in `sys.path` where a subdirectory `easybuild/easyconfigs` can be found. This is not something configurable, and I'm not sure if it's worth to define a constant for this. Defining a 'constant' using a function call feels weird...