Basic entity component framework in JavaScript