Enums, formatting, cmake, switch/case and various minor changes