Added 'inventory item' behavior, fixed some player-related bugs. Minor refactoring.