Cleanup of the code

- Separate enums and constants correctly into header files
- typedef enums
- Put things in the correct header files