ECS refactoring/rewrite (WIP)

- Other minor changes.