made some functions static
Cleaned up and fixed bug in inventory size
cleaned up
removed gotos
Changed global inpack to a function

Basically, it will traverse the linked list each time we need to know how many
items there are, but as there are at most only 23 links, this shouldn't be
noticeable. Especially since this is a turn-based game, we are not in a hurry
here.