[WIP] Levels IOP: add automatic mode

Do NOT merge!
I think, this is fully functional(that is why it is a PR already), but i still need to redo the GUI.

Now you can set black/gray/white percentiles, and store as a preset - will work as expected.