Updates on the layout module

Fixes for some known issues of the layout module:
- the layouts eventually doesn't show up at the dropdown menu
- the layouts file saved using the save button isn't well formatted
- crash on startup

There are lots of other changes because of a merge from v0.8 to this branch (see the commits), the merge will probably be smart enough to know that these changes are already on master.