Began a refactoring of the main engine to obey safer, cleaner C++ practices.