fixing segfaults again
Made changes so SetActiveAppState uses the provided enums.
Renamed eflat to engine, uppercased filenames and class names.