Implementing an Entity Component System in JavaScript