Generalize entity count by classname into its own method

Create a new method, Game_CountEntities, which takes a classname
parameter and returns the number of the given entity class currently
ingame.