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

Hi, I saw your post on reddit. Here are a few suggested changes.