Added componentByType() function to Entity.