Refactored most of Unit source code into Engine

-Most of the Unit's source code is moved into the engine,
 since the engine should be dealing with the logic and
 not the Unit itself.