Use SliceModeEnum as data type for the slice mode fields

This makes the use of the field clearer and safer by allowing
the compiler check that users actually assign proper enum
values.
Merge pull request #452 from mstorsjo/use-slice-mode-enum

Use SliceModeEnum as data type for the slice mode fields