Add labels preferences + minor fix.

- make the number of characters configurable
- add a regular expression to remove characters from the paths
- sorting also takes in account the labels
- a minor fix of some crazy reloading/refreshing caused by the "display" property in the folders.
- some refactors

The display now is not written to the file, but if the file has a display property is used (and not overwritten)