Move a bunch of functions from level.c into mob.c and player.c