moving entity system implementations to cpp
some fixes and tests