Restructured the engine and moved entity functionality into components.