Modlist profile saving and loading (#578 continued)

This is @woutervh- 's really cool work on profiles in #578 merged with our latest changes plus some fixes and command- line support.

*Work in progress, don't merge yet*