Use enum classes instead classical enums.

Moreover, specify the enum size. Of course all of this required
the C++11 compatible compiler.